home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Docs / Tutorials / ListViews.gc < prev    next >
Text File  |  1997-12-02  |  1KB  |  51 lines

  1. G4C
  2.  
  3. ; An example of a simple listview.
  4. ; --------------------------------------------------------------
  5.  
  6. ; This is a simple TXT type listview.
  7.  
  8. ; It has to be given the name of a file to display, and for
  9. ; this example we'll give it the "guis:docs/printme" file.
  10.  
  11.  
  12. WINBIG -1 -1 566 170 ListViews.gc   ; our window
  13. WinType 11110001                    ; resizable with all gadgets
  14. Box 0 0 0 0 out button              ; decorative window border
  15.  
  16. ; --------------------------------------------------------------
  17. ;       System events
  18. ; --------------------------------------------------------------
  19.  
  20. xOnLoad
  21. GuiOpen ListViews.gc
  22.  
  23. xOnClose
  24. GuiQuit ListViews.gc
  25.  
  26.  
  27. ; --------------------------------------------------------------
  28. ;       The listview
  29. ; --------------------------------------------------------------
  30.  
  31. ; this is the actual listview. Every time the user clicks on it, we'll
  32. ; display the text of the line the user clicked on, in our text gadget
  33. ; below (GadID 1)
  34.  
  35. XLISTVIEW 10 19 549 148 "" variable "guis:docs/Printme" 10 TXT
  36.  
  37.     ; update the TEXT gadget
  38.     update ListViews.gc 1 $variable
  39.  
  40.  
  41. ; --------------------------------------------------------------
  42. ;       The TEXT gadget
  43. ; --------------------------------------------------------------
  44.  
  45. ; This is the lucky gadget that gets to display the line..
  46.  
  47. TEXT 10 4 547 13 "Click any line.." 100 BOX
  48.     gadid 1
  49.  
  50.  
  51.